package com.atguigu.gmall.pms.api;

import com.atguigu.gmall.common.bean.PageParamVo;
import com.atguigu.gmall.common.bean.ResponseVo;
import com.atguigu.gmall.pms.entity.*;
import com.atguigu.gmall.pms.vo.ItemGroupVo;
import com.atguigu.gmall.pms.vo.SaleAttrValueVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

public interface GmallPmsApi {
    @GetMapping("pms/spu/{id}")
     ResponseVo<SpuEntity> querySpuById(@PathVariable("id") Long id);

    @PostMapping("pms/spu/page")
   ResponseVo<List<SpuEntity>> querySpuByPagevo(@RequestBody PageParamVo paramVo);

 @GetMapping("pms/spudesc/{spuId}")
 ResponseVo<SpuDescEntity> querySpuDescById(@PathVariable("spuId") Long spuId);

    @GetMapping("pms/sku/spu/{spuId}")
    ResponseVo<List<SkuEntity>> querySkuBySpuId(@PathVariable long spuId);

    @GetMapping("pms/skuattrvalue/spu/{spuId}")
    ResponseVo<List<SaleAttrValueVo>> querySaleAttrValuesBySpuId(@PathVariable Long spuId);

 @GetMapping("pms/skuattrvalue/mapping/{spuId}")
  ResponseVo<String> queryMappingBySpuId(@PathVariable Long spuId);

 @GetMapping("pms/skuattrvalue/skuAttr/{skuId}")
 ResponseVo<List<SkuAttrValueEntity>> querySaleAttrValuesBySkuId(@PathVariable Long skuId);
    @GetMapping("pms/sku/{id}")
    ResponseVo<SkuEntity> querySkuById(@PathVariable("id") Long id);

    @GetMapping("pms/skuimages/sku/{skuId}")
    ResponseVo<List<SkuImagesEntity>> querySkuImagesByskuId(@PathVariable Long skuId);

    @GetMapping("pms/brand/{id}")
   ResponseVo<BrandEntity> queryBrandById(@PathVariable("id") Long id);

    @GetMapping("pms/category/{id}")
     ResponseVo<CategoryEntity> queryCategoryById(@PathVariable("id") Long id);

    @GetMapping("pms/category/index/cates/{pid}")
    ResponseVo<List<CategoryEntity>> queryCategoriesWithSub(@PathVariable Long pid);

    @GetMapping("pms/category/parent/{parentId}")
     ResponseVo<List<CategoryEntity>> getCategorys(@PathVariable String parentId);

    @GetMapping("pms/category/query123/{cid}")
    ResponseVo<List<CategoryEntity>> queryCategoryEntity123ByCid(@PathVariable Long cid);

    @GetMapping("pms/attrgroup/with/attr/value/{cid}")
     ResponseVo<List<ItemGroupVo>> queryAttrGroupBySpuIdAndCidAndSkuId(
            @PathVariable Long cid,
            @RequestParam("skuId") Long skuId,
            @RequestParam("spuId") Long spuId
    );


    @GetMapping("pms/skuattrvalue/sku/{cid}")
    ResponseVo<List<SkuAttrValueEntity>> querySearchAttrValueByCidAndSkuId(
            @PathVariable long cid,@RequestParam("skuId") long skuId);

    @GetMapping("pms/spuattrvalue/spu/{cid}")
     ResponseVo<List<SpuAttrValueEntity>> querySearchAttrValueByCidAndSpuId(
            @PathVariable long cid,@RequestParam("spuId") long spuId
    );
}
